#include <stdio.h>
#include <string.h>

#define LEN 128

int getLength(char *string) {
    int i;
    int sum = 0, len = strlen(string);
    for (i = 0; i < len; i++) {
        if (*(string + i) != ' ')
            sum++;
    }

    return sum;
}

int main(int argc, char *argv[]) {

    char *cypher = "tky ghk pdrb jyw;; d jkubu edg ypd. ypwj hc uwjw.av d.o epwfp wj eph;;g w. ghkh he. ihebu";

    int array[LEN] = { 0 };
    int i, length = getLength(cypher);

    for (i = 0; i < length; i++) {
        array[(int) *(cypher + i)]++;
    }

    for (i = 0; i < LEN; i++) {
        if (array[i])
            printf("'%c' : %d : %5.3f\%\n", (char) i, array[i], (double) array[i] / length * 100);
    }

    return 0;
}
